﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 数组
{
    class Program
    {
        static void Main(string[] args)
        {

            int[] arr = { 1, 2, 3, 4, 5 };

            for (int i = 0; i < arr.Length; i++) { Console.Write(arr[i]); }
            Console.WriteLine();
            string[,] arr2 = { { "123", "234" }, { "3543", "54354" }, { "756", "896768" } };
            for (int i = 0; i < arr2.GetLength(0); i++)
            {
                for (int h = 0; h < arr2.GetLength(1); h++)
                {
                    Console.Write(arr2[i, h]);

                }

            }
            Console.WriteLine("foreach的用法");
            int[] arr3 = { 1, 2, 3, 4, 5 };
            foreach (int y in arr3)
            {
                Console.Write(y);
            }
            Console.WriteLine("split的用法");
            string str = "晚上吃什么,奇迹上斋现,天天上天吃鸡";
            var t = str.Split(',');
            for (int u = 0; u < t.Length; u++)
            {
                Console.WriteLine(t[u]);
            }
            Console.WriteLine("split演示");
            string str1 = "花有重开日,人无再少年";
            var b = str1.Split('花');
            for (int i = 0; i < b.Length; i++)
            {
                Console.WriteLine(b[i]);
            }
        }

}

}
